@extends('admin.master')
<script src="/js/admin/chargeRecordsNotes.js"></script>
@section('title', '购买流量记录')
	
@section('firstItem')
@parent
				<span class="linkBtn" onclick="window.location.href='/admin/device/chargeRecords'">充值管理</span> &raquo; 
				<span>购买流量记录</span>
				<input class="a_indexbg" type="hidden" value="chargerecords" />
@stop
@section('searchList')
@parent		
				<div class="seizeBox"></div>
@stop
@section('dataTables')
@parent
			<table class="rechargeNotes dataTables" cellspacing="0" cellpadding="0">
				<thead>
					<tr>
						<td>序号</td>
						<td>设备编号</td>
						<td>用户名</td>
						<td>手机号码</td>
						<td>剩余流量</td>
						<td>购买金额</td>
						<td>购买流量数</td>
						<td>购买人</td>
						<td>后台充值人</td>
						<td>撤销流量数</td>
						<td>撤销操作人</td>
						<td>时间</td>
						<td>备注信息</td>
						<td>撤销充值</td>
					</tr>
				</thead>
				<tbody>
					@for($i=0, $chargeRecordCount=count($charge_records); $i<$chargeRecordCount; $i++)
					<tr >
						<td>{{ $i+1 }}</td>
						<td class="deviceCodeCell devicecodeVal">{{ $charge_records[$i]->device->code }}</td>
						<td class="userNameCell">{{ $charge_records[$i]->device->installInfo->customer_name or '' }}</td>
						<td>{{ $charge_records[$i]->userInfo->phone or '' }}</td>
						<td class="revokeFluxCell">{{ $charge_records[$i]->residual_flow }}L</td>
						<td>{{ $charge_records[$i]->money or 0 }}元</td>
						<td>{{ $charge_records[$i]->flow }}L</td>
						<td>{{ $charge_records[$i]->userInfo->name or '' }}</td>
						<td>{{ $charge_records[$i]->adminInfo->name or '' }}</td>
						<td>{{ is_null($charge_records[$i]->discharge_flow)? '': $charge_records[$i]->discharge_flow.'L'}}</td>
						<td class="revokeAddTextCell">{{ $charge_records[$i]->dischargeAdmin->name or '' }}</td>
						<td>{{ $charge_records[$i]->created_at }}</td>
						<td class="addTextCell" style="width:200px;">{{ $charge_records[$i]->remark }}</td>
						<td><a class="revokeBtn">撤销</a><input class="device_id" type="hidden" value="{{ $charge_records[$i]->device_id }}" /><input class="charge_record_id" type="hidden" value="{{ $charge_records[$i]->id }}" /></td>
					</tr>
					@endfor
				</tbody>
			</table>
@stop
@section('page_num')
<ul class="pagination pagination-lg"> 
	@if(!is_null($charge_records->first()))
	{!! $charge_records->appends(['device_id' => $charge_records->first()->device_id])->render() !!}
	@endif
</ul>
@stop
@section('infor_promit')
@parent
	<!-- 撤回流量框 -->
	<div class="payFluxBg revokeManageBg">
		<div class="payFlux revokeManage" >
			<p class="titleTxt">撤回流量</p>
			<div class="displayBox p_relative">
				<div>
					<p><span>设备编码:</span><label class="revokeDeviceCode"></label></p>
					<p><span>剩余流量:</span><label class="revokeResidueFlux"></label></p>
				</div>
				<div >
					<p><span>用户名:</span><label class="revokeGetUserName" style="width: 200px;display: block;float: right;"></label></p>
					<p><span>安装地址:</span><label class="revokeGetAddress" style="width: 200px;display: block;float: right;"></label></p>
				</div>
				<textarea class="textareaBox revokeAddText" placeholder="备注信息："></textarea>
				<label style="color:#63C3D1;">每条充值记录只能撤销操作一次，请谨慎操作</label>
				<div class="payBox">撤回流量(L)<input class="chargeFluxBox revokeFluxBox" type="text" value="" placeholder="请填整数" /><label class="required">*</label></div>
				<label class="labelBox revokeLabelBox"></label>
			</div>
			<div class="btnBox" style="margin-top: 40px;">
				<a class="cancelBtn revokeCancelBtn">取消</a>
				<a class="okBtn revokeOkBtn">确定</a>
			</div>
		</div>
	</div>
@stop
